* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    line-height: 1.6;
    color: #333333;
    background-color: #F5F6F5;
}

header {
    background-color: #D70000;
    color: #FFFFFF;
    padding: 1rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

header img {
    max-height: 70px;
}

header .title-text {
    font-size: 1.8rem;
    font-weight: bold;
}

nav.main-nav {
    background-color: #FFFFFF;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav.main-nav a {
    color: #D70000;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 1.1rem;
}

nav.main-nav a:hover {
    background-color: #A30000;
    color: #FFFFFF;
}

.language-switcher {
    padding: 0.5rem;
    border-radius: 4px;
    background-color: #FFFFFF;
    color: #333333;
    border: 1px solid #D70000;
    font-size: 1rem;
}

.machinery-section {
    max-width: 1200px;
    margin: 1em auto;
    padding: 1rem;
}

.machinery-section h2 {
    text-align: center;
    color: #D70000;
    margin-bottom: 0.5rem;
}

.search-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.search-filters label {
    font-weight: bold;
    color: #333333;
    white-space: nowrap;
}

.search-filters select, .search-filters input {
    padding: 0.5rem;
    border: 1px solid #FFE6E6;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    max-width: 200px;
    box-sizing: border-box;
}

.machinery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
}

.machinery-card {
    background-color: #FFFFFF;
    border: 1px solid #FFE6E6;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    height: auto;
    display: flex;
    flex-direction: column;
}

.machinery-card:hover {
    transform: translateY(-3px);
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-images {
    width: 100%;
}

.carousel-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    max-height: 150px;
    transition: opacity 0.5s;
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(215, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-prev:hover, .carousel-next:hover {
    background-color: rgba(163, 0, 0, 0.7);
}

.machinery-card-content {
    padding: 0.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.machinery-card h3 {
    font-size: 1.5rem;
    color: #D70000;
    margin-bottom: 0.5rem;
    display: none;
}

.machinery-card .machine-header {
    font-size: 1rem;
    color: #D70000;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.machinery-card .location, .machinery-card .price {
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

.machinery-card .location .label, .machinery-card .price .label {
    font-weight: bold;
}

.machinery-card .location .value, .machinery-card .price .value {
    font-weight: normal;
}

.machinery-card .contact-button {
    background-color: #D70000;
    color: #FFFFFF;
    padding: 0.9rem 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100px;
    align-self: center;
    margin-top: 0.5rem;
    transition: background-color 0.3s, transform 0.2s;
}

.machinery-card .contact-button:hover {
    background-color: #A30000;
    transform: scale(1.03);
}

.contact-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.contact-popup .popup-content {
    background: #FFFFFF;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    height: auto;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid #FFE6E6;
}

.contact-popup .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #D70000;
    cursor: pointer;
}

.contact-popup .close-button:hover {
    color: #A30000;
}

.contact-popup h3 {
    color: #D70000;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

.form-container iframe {
    width: 100%;
    height: 600px;
    border: none;
}

footer {
    background-color: #D70000;
    color: #FFFFFF;
    text-align: center;
    padding: 1rem;
    width: 100%;
    margin-top: 2rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: #FFFFFF;
    margin: 0 1rem;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #FFE6E6;
}

@media (max-width: 600px) {
    header {
        flex-direction: row;
        padding: 0.5rem;
        justify-content: center;
        align-items: center;
    }

    header img {
        max-height: 50px;
    }

    header .title-text {
        font-size: 1.5rem;
    }

    nav.main-nav {
        flex-direction: row;
        padding: 0.5rem 0;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
    }

    nav.main-nav ul {
        flex-direction: row;
        gap: 0.5rem;
    }

    nav.main-nav a {
        padding: 0.3rem 0.5rem;
        font-size: 1rem;
    }

    .language-switcher {
        width: 100%;
        max-width: 150px;
        margin-top: 0.5rem;
    }

    .search-filters {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .search-filters select, .search-filters input {
        max-width: 100%;
    }

    .machinery-grid {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .machinery-card img {
        height: 120px;
    }

    .contact-popup .popup-content {
        max-width: 90%;
        padding: 1rem;
    }

    .form-container iframe {
        height: 450px;
    }

    .contact-popup .close-button {
        font-size: 1rem;
    }

    .contact-popup h3 {
        font-size: 1.2rem;
    }

    .carousel-prev, .carousel-next {
        padding: 8px;
        font-size: 16px;
    }
    }
